package com.glsc.ngateway.platform.service;

import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.TRPARequest;
import com.glsc.ngateway.common.base.repo.mysql.gateway.platform.TRPARequestRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class RPAService {

    private static final Logger logger = LoggerFactory.getLogger(RPAService.class);

    @Autowired
    TRPARequestRepository trpaRequestRepository;

    public Page<TRPARequest> getAllRequestList(Integer page, Integer size) {

        Pageable pageable = PageRequest.of(page - 1, size);
        Page<TRPARequest> list = trpaRequestRepository.findAllByOrderByStatusAscCreateTimeDesc(pageable);
        return list;
    }

}
